<?php
/**
 * @package LaravelBoot
 *
 * @internal
 *
 * @author mawenpei
 * @date 2019/3/16 11:28
 * @version
 */
namespace App\Models;

use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class PushMessageRecord extends Model
{
    protected $table = 'push_message_record';

    protected $guarded = [];

    public $appends = ['status_name'];

    public function getStatusNameAttribute()
    {
        //推送状态0未开始1推送中2已推送
        switch ($this->status) {
            case 0:
                return '未推送';
            case 1:
                return '推送中';
            case 2:
                return '已推送';
            case 3:
                return '推送失败';
        }
    }
}